package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TSamplingTaskMapper;
import com.ruoyi.system.domain.TSamplingTask;
import com.ruoyi.system.service.ITSamplingTaskService;
import com.ruoyi.common.core.text.Convert;

/**
 * 抽检任务Service业务层处理
 * 
 * @author wuym
 * @date 2021-07-05
 */
@Service
public class TSamplingTaskServiceImpl implements ITSamplingTaskService 
{
    @Autowired
    private TSamplingTaskMapper tSamplingTaskMapper;

    /**
     * 查询抽检任务
     * 
     * @param id 抽检任务ID
     * @return 抽检任务
     */
    @Override
    public TSamplingTask selectTSamplingTaskById(Long id)
    {
        return tSamplingTaskMapper.selectTSamplingTaskById(id);
    }

    /**
     * 查询抽检任务列表
     * 
     * @param tSamplingTask 抽检任务
     * @return 抽检任务
     */
    @Override
    public List<TSamplingTask> selectTSamplingTaskList(TSamplingTask tSamplingTask)
    {
        return tSamplingTaskMapper.selectTSamplingTaskList(tSamplingTask);
    }

    /**
     * 新增抽检任务
     * 
     * @param tSamplingTask 抽检任务
     * @return 结果
     */
    @Override
    public int insertTSamplingTask(TSamplingTask tSamplingTask)
    {
        tSamplingTask.setCreateTime(DateUtils.getNowDate());
        return tSamplingTaskMapper.insertTSamplingTask(tSamplingTask);
    }

    /**
     * 修改抽检任务
     * 
     * @param tSamplingTask 抽检任务
     * @return 结果
     */
    @Override
    public int updateTSamplingTask(TSamplingTask tSamplingTask)
    {
        tSamplingTask.setUpdateTime(DateUtils.getNowDate());
        return tSamplingTaskMapper.updateTSamplingTask(tSamplingTask);
    }

    /**
     * 删除抽检任务对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTSamplingTaskByIds(String ids)
    {
        return tSamplingTaskMapper.deleteTSamplingTaskByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除抽检任务信息
     * 
     * @param id 抽检任务ID
     * @return 结果
     */
    @Override
    public int deleteTSamplingTaskById(Long id)
    {
        return tSamplingTaskMapper.deleteTSamplingTaskById(id);
    }
}
